import babel from "rollup-plugin-babel";
import serve from "rollup-plugin-serve";

export default {
  input: "src/index.js",
  output: {
    file: "dist/umd/vue.js",
    format: "umd",
    name: "Vue", // 打包后的全局变量名
    sourcemap: true,
  },
  plugins: [
    process.env.ENV === "development"
      ? serve({
          port: 8091,
          contentBase: "./",
          open: true,
          openPage: "/public/index.html",
          host: "localhost",
        })
      : null,
    babel({
      exclude: "node_modules/**",
    }),
  ],
};
